Page({
   /**
   * 页面的初始数据
   */
  data: {
    device_position: 'back',     //纬度
  },
  takeToggles() {
    var that = this;
    if (this.data.device_position == 'front'){
      console.log('11');
      this.data.device_position = 'back'
      that.setData({
        device_position : 'back',
      });
    } else {
      console.log('22');
      this.data.device_position = 'front'
      that.setData({
        device_position : 'front',
      });
    }
    
  },
  takePhoto() {
    const ctx = wx.createCameraContext()
    ctx.takePhoto({
      quality: 'high',
      success: (res) => {
        this.setData({
          src: res.tempImagePath
        })
      }
    })
  },
  error(e) {
    console.log(e.detail)
  }
})